// 8_2.c
#include <stdio.h>
int main()
{
#define MAXGRADES 5
    int grades[MAXGRADES];
    int i, total = 0;

    /*input the grades*/
    for (i = 0; i < MAXGRADES; i++)
    {
        printf("Enter a grade: ");
        scanf("%d", &grades[i]);
    }

    /*display and total the grades */
    printf("\nThe total of the grades ");
    for (i = 0; i < MAXGRADES; i++)
    {
        printf("%d ", grades[i]);
        total += grades[i];
    }
    printf("is %d\n", total); /*display the total*/

    return 0;
}